package com.zhixue.learning.feignclient;

import com.zhixue.content.model.po.CoursePublish;
import com.zhixue.content.model.po.Teachplan;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Dragon
 * @description ContentServiceClient
 * @date 2023/10/22 14:45
 */
@FeignClient(value = "content-api",fallbackFactory = ContentServiceClientFallbackFactory.class)
public interface ContentServiceClient {

    /**
     * 查询课程发布信息
     * @param courseId
     * @return
     */
    @ResponseBody
    @GetMapping("/content/r/coursepublish/{courseId}")
    CoursePublish getCoursePublish(@PathVariable("courseId") Long courseId);


    /**
     * 查询教学计划
     * @param teachplanId
     * @return
     */
    @PostMapping("/content/teachplan/{teachplanId}")
    Teachplan getTeachplan(@PathVariable("teachplanId") Long teachplanId);
    //在写这我发现一个有趣的问题，就是在feign中这个@PathVariable不能为空参
}
